<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/memcontrol.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/memcontrol.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="k">/* memcontrol.h - Memory Controller</span>
<a name="2" /><span class="True">       2:</span> <span class="k"> *</span>
<a name="3" /><span class="True">       3:</span> <span class="k"> * Copyright IBM Corporation, 2007</span>
<a name="4" /><span class="True">       4:</span> <span class="k"> * Author Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;</span>
<a name="5" /><span class="True">       5:</span> <span class="k"> *</span>
<a name="6" /><span class="True">       6:</span> <span class="k"> * Copyright 2007 OpenVZ SWsoft Inc</span>
<a name="7" /><span class="True">       7:</span> <span class="k"> * Author: Pavel Emelianov &lt;xemul@openvz.org&gt;</span>
<a name="8" /><span class="True">       8:</span> <span class="k"> *</span>
<a name="9" /><span class="True">       9:</span> <span class="k"> * This program is free software; you can redistribute it and/or modify</span>
<a name="10" /><span class="True">      10:</span> <span class="k"> * it under the terms of the GNU General Public License as published by</span>
<a name="11" /><span class="True">      11:</span> <span class="k"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="12" /><span class="True">      12:</span> <span class="k"> * (at your option) any later version.</span>
<a name="13" /><span class="True">      13:</span> <span class="k"> *</span>
<a name="14" /><span class="True">      14:</span> <span class="k"> * This program is distributed in the hope that it will be useful,</span>
<a name="15" /><span class="True">      15:</span> <span class="k"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="16" /><span class="True">      16:</span> <span class="k"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="17" /><span class="True">      17:</span> <span class="k"> * GNU General Public License for more details.</span>
<a name="18" /><span class="True">      18:</span> <span class="k"> */</span>
<a name="19" /><span class="True">      19:</span> 
<a name="20" /><span class="True">      20:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX01FTUNPTlRST0xfSF8w"><span class="b">_LINUX_MEMCONTROL_H</span></a>
<a name="21" /><span class="True">      21:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX01FTUNPTlRST0xfSF8w"><span class="b">_LINUX_MEMCONTROL_H</span></a>
<a name="22" /><span class="True">      22:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">cgroup</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="23" /><span class="True">      23:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">vm_event_item</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="24" /><span class="True">      24:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">hardirq</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="25" /><span class="True">      25:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">jump_label</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="26" /><span class="True">      26:</span> 
<a name="27" /><span class="True">      27:</span> <span class="m">struct</span> <span class="b">mem_cgroup</span><span class="f">;</span>
<a name="28" /><span class="True">      28:</span> <span class="m">struct</span> <span class="b">page_cgroup</span><span class="f">;</span>
<a name="29" /><span class="True">      29:</span> <span class="m">struct</span> <span class="b">page</span><span class="f">;</span>
<a name="30" /><span class="True">      30:</span> <span class="m">struct</span> <span class="b">mm_struct</span><span class="f">;</span>
<a name="31" /><span class="True">      31:</span> <span class="m">struct</span> <span class="b">kmem_cache</span><span class="f">;</span>
<a name="32" /><span class="True">      32:</span> 
<a name="33" /><span class="True">      33:</span> <span class="k">/*</span>
<a name="34" /><span class="True">      34:</span> <span class="k"> * The corresponding mem_cgroup_stat_names is defined in mm/memcontrol.c,</span>
<a name="35" /><span class="True">      35:</span> <span class="k"> * These two lists should keep in accord with each other.</span>
<a name="36" /><span class="True">      36:</span> <span class="k"> */</span>
<a name="37" /><span class="True">      37:</span> <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="f">{</span>
<a name="38" /><span class="True">      38:</span>     <span class="k">/*</span>
<a name="39" /><span class="True">      39:</span> <span class="k">     * For MEM_CONTAINER_TYPE_ALL, usage = pagecache + rss.</span>
<a name="40" /><span class="True">      40:</span> <span class="k">     */</span>
<a name="41" /><span class="True">      41:</span>     <span class="b">MEM_CGROUP_STAT_CACHE</span><span class="f">,</span>        <span class="k">/* # of pages charged as cache */</span>
<a name="42" /><span class="True">      42:</span>     <span class="b">MEM_CGROUP_STAT_RSS</span><span class="f">,</span>        <span class="k">/* # of pages charged as anon rss */</span>
<a name="43" /><span class="True">      43:</span>     <span class="b">MEM_CGROUP_STAT_RSS_HUGE</span><span class="f">,</span>    <span class="k">/* # of pages charged as anon huge */</span>
<a name="44" /><span class="True">      44:</span>     <span class="b">MEM_CGROUP_STAT_FILE_MAPPED</span><span class="f">,</span>    <span class="k">/* # of pages charged as file rss */</span>
<a name="45" /><span class="True">      45:</span>     <span class="b">MEM_CGROUP_STAT_WRITEBACK</span><span class="f">,</span>    <span class="k">/* # of pages under writeback */</span>
<a name="46" /><span class="True">      46:</span>     <span class="b">MEM_CGROUP_STAT_SWAP</span><span class="f">,</span>        <span class="k">/* # of pages, swapped out */</span>
<a name="47" /><span class="True">      47:</span>     <span class="b">MEM_CGROUP_STAT_NSTATS</span><span class="f">,</span>
<a name="48" /><span class="True">      48:</span> <span class="f">}</span><span class="f">;</span>
<a name="49" /><span class="True">      49:</span> 
<a name="50" /><span class="True">      50:</span> <span class="m">struct</span> <span class="b">mem_cgroup_reclaim_cookie</span> <span class="f">{</span>
<a name="51" /><span class="True">      51:</span>     <span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">;</span>
<a name="52" /><span class="True">      52:</span>     <span class="m">int</span> <span class="b">priority</span><span class="f">;</span>
<a name="53" /><span class="True">      53:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">generation</span><span class="f">;</span>
<a name="54" /><span class="True">      54:</span> <span class="f">}</span><span class="f">;</span>
<a name="55" /><span class="True">      55:</span> 
<a name="56" /><span class="False">      56:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG</span>
<a name="57" /><span class="False">      57:</span> <span class="k">/*</span>
<a name="58" /><span class="False">      58:</span> <span class="k"> * All &quot;charge&quot; functions with gfp_mask should use GFP_KERNEL or</span>
<a name="59" /><span class="False">      59:</span> <span class="k"> * (gfp_mask &amp; GFP_RECLAIM_MASK). In current implementatin, memcg doesn&apos;t</span>
<a name="60" /><span class="False">      60:</span> <span class="k"> * alloc memory but reclaims memory from all available zones. So, &quot;where I want</span>
<a name="61" /><span class="False">      61:</span> <span class="k"> * memory from&quot; bits of gfp_mask has no meaning. So any bits of that field is</span>
<a name="62" /><span class="False">      62:</span> <span class="k"> * available but adding a rule is better. charge functions&apos; gfp_mask should</span>
<a name="63" /><span class="False">      63:</span> <span class="k"> * be set to GFP_KERNEL or gfp_mask &amp; GFP_RECLAIM_MASK for avoiding ambiguous</span>
<a name="64" /><span class="False">      64:</span> <span class="k"> * codes.</span>
<a name="65" /><span class="False">      65:</span> <span class="k"> * (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.)</span>
<a name="66" /><span class="False">      66:</span> <span class="k"> */</span>
<a name="67" /><span class="False">      67:</span> 
<a name="68" /><span class="False">      68:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mem_cgroup_newpage_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="69" /><span class="False">      69:</span>                 <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span><span class="f">;</span>
<a name="70" /><span class="False">      70:</span> <span class="k">/* for swap handling */</span>
<a name="71" /><span class="False">      71:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mem_cgroup_try_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="72" /><span class="False">      72:</span>         <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">mask</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcgp</span><span class="f">)</span><span class="f">;</span>
<a name="73" /><span class="False">      73:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_commit_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="74" /><span class="False">      74:</span>                     <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="75" /><span class="False">      75:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_cancel_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="76" /><span class="False">      76:</span> 
<a name="77" /><span class="False">      77:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mem_cgroup_cache_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="78" /><span class="False">      78:</span>                     <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span><span class="f">;</span>
<a name="79" /><span class="False">      79:</span> 
<a name="80" /><span class="False">      80:</span> <span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">mem_cgroup_zone_lruvec</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="81" /><span class="False">      81:</span> <span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">mem_cgroup_page_lruvec</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="82" /><span class="False">      82:</span> 
<a name="83" /><span class="False">      83:</span> <span class="k">/* For coalescing uncharge for reducing memcg&apos; overhead*/</span>
<a name="84" /><span class="False">      84:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_start</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="85" /><span class="False">      85:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_end</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="86" /><span class="False">      86:</span> 
<a name="87" /><span class="False">      87:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="88" /><span class="False">      88:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_cache_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="89" /><span class="False">      89:</span> 
<a name="90" /><span class="False">      90:</span> <span class="m">bool</span> <span class="b">__mem_cgroup_same_or_subtree</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">root_memcg</span><span class="f">,</span>
<a name="91" /><span class="False">      91:</span>                   <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="92" /><span class="False">      92:</span> <span class="m">bool</span> <span class="b">task_in_mem_cgroup</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">task</span><span class="f">,</span>
<a name="93" /><span class="False">      93:</span>             <span class="m">const</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="94" /><span class="False">      94:</span> 
<a name="95" /><span class="False">      95:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">try_get_mem_cgroup_from_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="96" /><span class="False">      96:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem_cgroup_from_task</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span><span class="f">;</span>
<a name="97" /><span class="False">      97:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">try_get_mem_cgroup_from_mm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span><span class="f">;</span>
<a name="98" /><span class="False">      98:</span> 
<a name="99" /><span class="False">      99:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">parent_mem_cgroup</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="100" /><span class="False">     100:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem_cgroup_from_css</span><span class="f">(</span><span class="m">struct</span> <span class="b">cgroup_subsys_state</span> <span class="f">*</span><span class="b">css</span><span class="f">)</span><span class="f">;</span>
<a name="101" /><span class="False">     101:</span> 
<a name="102" /><span class="False">     102:</span> <span class="m">static</span> <span class="m">inline</span>
<a name="103" /><span class="False">     103:</span> <span class="m">bool</span> <span class="b">mm_match_cgroup</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="104" /><span class="False">     104:</span> <span class="f">{</span>
<a name="105" /><span class="False">     105:</span>     <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">task_memcg</span><span class="f">;</span>
<a name="106" /><span class="False">     106:</span>     <span class="m">bool</span> <span class="b">match</span><span class="f">;</span>
<a name="107" /><span class="False">     107:</span> 
<a name="108" /><span class="False">     108:</span>     <span class="b">rcu_read_lock</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="109" /><span class="False">     109:</span>     <span class="b">task_memcg</span> <span class="f">=</span> <span class="b">mem_cgroup_from_task</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_cmN1X2RlcmVmZXJlbmNlXzA_"><span class="b">rcu_dereference</span></a><span class="f">(</span><span class="b">mm</span><span class="f">-&gt;</span><span class="b">owner</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="110" /><span class="False">     110:</span>     <span class="b">match</span> <span class="f">=</span> <span class="b">__mem_cgroup_same_or_subtree</span><span class="f">(</span><span class="b">memcg</span><span class="f">,</span> <span class="b">task_memcg</span><span class="f">)</span><span class="f">;</span>
<a name="111" /><span class="False">     111:</span>     <span class="b">rcu_read_unlock</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="112" /><span class="False">     112:</span>     <span class="m">return</span> <span class="b">match</span><span class="f">;</span>
<a name="113" /><span class="False">     113:</span> <span class="f">}</span>
<a name="114" /><span class="False">     114:</span> 
<a name="115" /><span class="False">     115:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">cgroup_subsys_state</span> <span class="f">*</span><span class="b">mem_cgroup_css</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="116" /><span class="False">     116:</span> 
<a name="117" /><span class="False">     117:</span> <span class="m">extern</span> <span class="m">void</span>
<a name="118" /><span class="False">     118:</span> <span class="b">mem_cgroup_prepare_migration</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">,</span>
<a name="119" /><span class="False">     119:</span>                  <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcgp</span><span class="f">)</span><span class="f">;</span>
<a name="120" /><span class="False">     120:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_end_migration</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span>
<a name="121" /><span class="False">     121:</span>     <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">oldpage</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">,</span> <span class="m">bool</span> <span class="b">migration_ok</span><span class="f">)</span><span class="f">;</span>
<a name="122" /><span class="False">     122:</span> 
<a name="123" /><span class="False">     123:</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem_cgroup_iter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">,</span>
<a name="124" /><span class="False">     124:</span>                    <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">,</span>
<a name="125" /><span class="False">     125:</span>                    <span class="m">struct</span> <span class="b">mem_cgroup_reclaim_cookie</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="126" /><span class="False">     126:</span> <span class="m">void</span> <span class="b">mem_cgroup_iter_break</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="127" /><span class="False">     127:</span> 
<a name="128" /><span class="False">     128:</span> <span class="k">/*</span>
<a name="129" /><span class="False">     129:</span> <span class="k"> * For memory reclaim.</span>
<a name="130" /><span class="False">     130:</span> <span class="k"> */</span>
<a name="131" /><span class="False">     131:</span> <span class="m">int</span> <span class="b">mem_cgroup_inactive_anon_is_low</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">)</span><span class="f">;</span>
<a name="132" /><span class="False">     132:</span> <span class="m">int</span> <span class="b">mem_cgroup_select_victim_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="133" /><span class="False">     133:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">mem_cgroup_get_lru_size</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">,</span> <span class="m">enum</span> <span class="b">lru_list</span><span class="f">)</span><span class="f">;</span>
<a name="134" /><span class="False">     134:</span> <span class="m">void</span> <span class="b">mem_cgroup_update_lru_size</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="f">,</span> <span class="m">enum</span> <span class="b">lru_list</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="135" /><span class="False">     135:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_print_oom_info</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span>
<a name="136" /><span class="False">     136:</span>                     <span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span><span class="f">;</span>
<a name="137" /><span class="False">     137:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_replace_page_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">oldpage</span><span class="f">,</span>
<a name="138" /><span class="False">     138:</span>                     <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">)</span><span class="f">;</span>
<a name="139" /><span class="False">     139:</span> 
<a name="140" /><span class="False">     140:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_oom_enable</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="141" /><span class="False">     141:</span> <span class="f">{</span>
<a name="142" /><span class="False">     142:</span>     <a href="cpu.c_macros_ref.html#_V0FSTl9PTl8w"><span class="b">WARN_ON</span></a><span class="f">(</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">memcg_oom</span><span class="f">.</span><span class="b">may_oom</span><span class="f">)</span><span class="f">;</span>
<a name="143" /><span class="False">     143:</span>     <a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">memcg_oom</span><span class="f">.</span><span class="b">may_oom</span> <span class="f">=</span> <span class="c">1</span><span class="f">;</span>
<a name="144" /><span class="False">     144:</span> <span class="f">}</span>
<a name="145" /><span class="False">     145:</span> 
<a name="146" /><span class="False">     146:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_oom_disable</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="147" /><span class="False">     147:</span> <span class="f">{</span>
<a name="148" /><span class="False">     148:</span>     <a href="cpu.c_macros_ref.html#_V0FSTl9PTl8w"><span class="b">WARN_ON</span></a><span class="f">(</span><span class="f">!</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">memcg_oom</span><span class="f">.</span><span class="b">may_oom</span><span class="f">)</span><span class="f">;</span>
<a name="149" /><span class="False">     149:</span>     <a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">memcg_oom</span><span class="f">.</span><span class="b">may_oom</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>
<a name="150" /><span class="False">     150:</span> <span class="f">}</span>
<a name="151" /><span class="False">     151:</span> 
<a name="152" /><span class="False">     152:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">task_in_memcg_oom</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span>
<a name="153" /><span class="False">     153:</span> <span class="f">{</span>
<a name="154" /><span class="False">     154:</span>     <span class="m">return</span> <span class="b">p</span><span class="f">-&gt;</span><span class="b">memcg_oom</span><span class="f">.</span><span class="b">memcg</span><span class="f">;</span>
<a name="155" /><span class="False">     155:</span> <span class="f">}</span>
<a name="156" /><span class="False">     156:</span> 
<a name="157" /><span class="False">     157:</span> <span class="m">bool</span> <span class="b">mem_cgroup_oom_synchronize</span><span class="f">(</span><span class="m">bool</span> <span class="b">wait</span><span class="f">)</span><span class="f">;</span>
<a name="158" /><span class="False">     158:</span> 
<a name="159" /><span class="False">     159:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG_SWAP</span>
<a name="160" /><span class="False">     160:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">do_swap_account</span><span class="f">;</span>
<a name="161" /><span class="False">     161:</span> <span class="f">#</span><span class="n">endif</span>
<a name="162" /><span class="False">     162:</span> 
<a name="163" /><span class="False">     163:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">mem_cgroup_disabled</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="164" /><span class="False">     164:</span> <span class="f">{</span>
<a name="165" /><span class="False">     165:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">mem_cgroup_subsys</span><span class="f">.</span><span class="b">disabled</span><span class="f">)</span>
<a name="166" /><span class="False">     166:</span>         <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="167" /><span class="False">     167:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="168" /><span class="False">     168:</span> <span class="f">}</span>
<a name="169" /><span class="False">     169:</span> 
<a name="170" /><span class="False">     170:</span> <span class="m">void</span> <span class="b">__mem_cgroup_begin_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">bool</span> <span class="f">*</span><span class="b">locked</span><span class="f">,</span>
<a name="171" /><span class="False">     171:</span>                      <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="172" /><span class="False">     172:</span> 
<a name="173" /><span class="False">     173:</span> <span class="m">extern</span> <span class="b">atomic_t</span> <span class="b">memcg_moving</span><span class="f">;</span>
<a name="174" /><span class="False">     174:</span> 
<a name="175" /><span class="False">     175:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_begin_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="176" /><span class="False">     176:</span>                     <span class="m">bool</span> <span class="f">*</span><span class="b">locked</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span>
<a name="177" /><span class="False">     177:</span> <span class="f">{</span>
<a name="178" /><span class="False">     178:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">mem_cgroup_disabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="179" /><span class="False">     179:</span>         <span class="m">return</span><span class="f">;</span>
<a name="180" /><span class="False">     180:</span>     <span class="b">rcu_read_lock</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="181" /><span class="False">     181:</span>     <span class="f">*</span><span class="b">locked</span> <span class="f">=</span> <span class="m">false</span><span class="f">;</span>
<a name="182" /><span class="False">     182:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">atomic_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">memcg_moving</span><span class="f">)</span><span class="f">)</span>
<a name="183" /><span class="False">     183:</span>         <span class="b">__mem_cgroup_begin_update_page_stat</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">locked</span><span class="f">,</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="184" /><span class="False">     184:</span> <span class="f">}</span>
<a name="185" /><span class="False">     185:</span> 
<a name="186" /><span class="False">     186:</span> <span class="m">void</span> <span class="b">__mem_cgroup_end_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="187" /><span class="False">     187:</span>                 <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="188" /><span class="False">     188:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_end_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="189" /><span class="False">     189:</span>                     <span class="m">bool</span> <span class="f">*</span><span class="b">locked</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span>
<a name="190" /><span class="False">     190:</span> <span class="f">{</span>
<a name="191" /><span class="False">     191:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">mem_cgroup_disabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="192" /><span class="False">     192:</span>         <span class="m">return</span><span class="f">;</span>
<a name="193" /><span class="False">     193:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">*</span><span class="b">locked</span><span class="f">)</span>
<a name="194" /><span class="False">     194:</span>         <span class="b">__mem_cgroup_end_update_page_stat</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="195" /><span class="False">     195:</span>     <span class="b">rcu_read_unlock</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="196" /><span class="False">     196:</span> <span class="f">}</span>
<a name="197" /><span class="False">     197:</span> 
<a name="198" /><span class="False">     198:</span> <span class="m">void</span> <span class="b">mem_cgroup_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="199" /><span class="False">     199:</span>                  <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="b">idx</span><span class="f">,</span>
<a name="200" /><span class="False">     200:</span>                  <span class="m">int</span> <span class="b">val</span><span class="f">)</span><span class="f">;</span>
<a name="201" /><span class="False">     201:</span> 
<a name="202" /><span class="False">     202:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_inc_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="203" /><span class="False">     203:</span>                         <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="b">idx</span><span class="f">)</span>
<a name="204" /><span class="False">     204:</span> <span class="f">{</span>
<a name="205" /><span class="False">     205:</span>     <span class="b">mem_cgroup_update_page_stat</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">idx</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="206" /><span class="False">     206:</span> <span class="f">}</span>
<a name="207" /><span class="False">     207:</span> 
<a name="208" /><span class="False">     208:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_dec_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="209" /><span class="False">     209:</span>                         <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="b">idx</span><span class="f">)</span>
<a name="210" /><span class="False">     210:</span> <span class="f">{</span>
<a name="211" /><span class="False">     211:</span>     <span class="b">mem_cgroup_update_page_stat</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">idx</span><span class="f">,</span> <span class="f">-</span><span class="c">1</span><span class="f">)</span><span class="f">;</span>
<a name="212" /><span class="False">     212:</span> <span class="f">}</span>
<a name="213" /><span class="False">     213:</span> 
<a name="214" /><span class="False">     214:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">mem_cgroup_soft_limit_reclaim</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">,</span>
<a name="215" /><span class="False">     215:</span>                         <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span>
<a name="216" /><span class="False">     216:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">total_scanned</span><span class="f">)</span><span class="f">;</span>
<a name="217" /><span class="False">     217:</span> 
<a name="218" /><span class="False">     218:</span> <span class="m">void</span> <span class="b">__mem_cgroup_count_vm_event</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">enum</span> <span class="b">vm_event_item</span> <span class="b">idx</span><span class="f">)</span><span class="f">;</span>
<a name="219" /><span class="False">     219:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_count_vm_event</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="220" /><span class="False">     220:</span>                          <span class="m">enum</span> <span class="b">vm_event_item</span> <span class="b">idx</span><span class="f">)</span>
<a name="221" /><span class="False">     221:</span> <span class="f">{</span>
<a name="222" /><span class="False">     222:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">mem_cgroup_disabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="223" /><span class="False">     223:</span>         <span class="m">return</span><span class="f">;</span>
<a name="224" /><span class="False">     224:</span>     <span class="b">__mem_cgroup_count_vm_event</span><span class="f">(</span><span class="b">mm</span><span class="f">,</span> <span class="b">idx</span><span class="f">)</span><span class="f">;</span>
<a name="225" /><span class="False">     225:</span> <span class="f">}</span>
<a name="226" /><span class="False">     226:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_TRANSPARENT_HUGEPAGE</span>
<a name="227" /><span class="False">     227:</span> <span class="m">void</span> <span class="b">mem_cgroup_split_huge_fixup</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">head</span><span class="f">)</span><span class="f">;</span>
<a name="228" /><span class="False">     228:</span> <span class="f">#</span><span class="n">endif</span>
<a name="229" /><span class="False">     229:</span> 
<a name="230" /><span class="False">     230:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_DEBUG_VM</span>
<a name="231" /><span class="False">     231:</span> <span class="m">bool</span> <span class="b">mem_cgroup_bad_page_check</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="232" /><span class="False">     232:</span> <span class="m">void</span> <span class="b">mem_cgroup_print_bad_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="233" /><span class="False">     233:</span> <span class="f">#</span><span class="n">endif</span>
<a name="234" /><span class="True">     234:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* CONFIG_MEMCG */</span>
<a name="235" /><span class="True">     235:</span> <span class="m">struct</span> <span class="b">mem_cgroup</span><span class="f">;</span>
<a name="236" /><span class="True">     236:</span> 
<a name="237" /><span class="True">     237:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">mem_cgroup_newpage_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="238" /><span class="True">     238:</span>                     <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span>
<a name="239" /><span class="True">     239:</span> <span class="f">{</span>
<a name="240" /><span class="True">     240:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="241" /><span class="True">     241:</span> <span class="f">}</span>
<a name="242" /><span class="True">     242:</span> 
<a name="243" /><span class="True">     243:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">mem_cgroup_cache_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="244" /><span class="True">     244:</span>                     <span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span>
<a name="245" /><span class="True">     245:</span> <span class="f">{</span>
<a name="246" /><span class="True">     246:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="247" /><span class="True">     247:</span> <span class="f">}</span>
<a name="248" /><span class="True">     248:</span> 
<a name="249" /><span class="True">     249:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">mem_cgroup_try_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="250" /><span class="True">     250:</span>         <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcgp</span><span class="f">)</span>
<a name="251" /><span class="True">     251:</span> <span class="f">{</span>
<a name="252" /><span class="True">     252:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="253" /><span class="True">     253:</span> <span class="f">}</span>
<a name="254" /><span class="True">     254:</span> 
<a name="255" /><span class="True">     255:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_commit_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="256" /><span class="True">     256:</span>                       <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="257" /><span class="True">     257:</span> <span class="f">{</span>
<a name="258" /><span class="True">     258:</span> <span class="f">}</span>
<a name="259" /><span class="True">     259:</span> 
<a name="260" /><span class="True">     260:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_cancel_charge_swapin</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="261" /><span class="True">     261:</span> <span class="f">{</span>
<a name="262" /><span class="True">     262:</span> <span class="f">}</span>
<a name="263" /><span class="True">     263:</span> 
<a name="264" /><span class="True">     264:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_start</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="265" /><span class="True">     265:</span> <span class="f">{</span>
<a name="266" /><span class="True">     266:</span> <span class="f">}</span>
<a name="267" /><span class="True">     267:</span> 
<a name="268" /><span class="True">     268:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_end</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="269" /><span class="True">     269:</span> <span class="f">{</span>
<a name="270" /><span class="True">     270:</span> <span class="f">}</span>
<a name="271" /><span class="True">     271:</span> 
<a name="272" /><span class="True">     272:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="273" /><span class="True">     273:</span> <span class="f">{</span>
<a name="274" /><span class="True">     274:</span> <span class="f">}</span>
<a name="275" /><span class="True">     275:</span> 
<a name="276" /><span class="True">     276:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_cache_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="277" /><span class="True">     277:</span> <span class="f">{</span>
<a name="278" /><span class="True">     278:</span> <span class="f">}</span>
<a name="279" /><span class="True">     279:</span> 
<a name="280" /><span class="True">     280:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">mem_cgroup_zone_lruvec</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">,</span>
<a name="281" /><span class="True">     281:</span>                             <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="282" /><span class="True">     282:</span> <span class="f">{</span>
<a name="283" /><span class="True">     283:</span>     <span class="m">return</span> <span class="f">&amp;</span><span class="b">zone</span><span class="f">-&gt;</span><span class="b">lruvec</span><span class="f">;</span>
<a name="284" /><span class="True">     284:</span> <span class="f">}</span>
<a name="285" /><span class="True">     285:</span> 
<a name="286" /><span class="True">     286:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">mem_cgroup_page_lruvec</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="287" /><span class="True">     287:</span>                             <span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">)</span>
<a name="288" /><span class="True">     288:</span> <span class="f">{</span>
<a name="289" /><span class="True">     289:</span>     <span class="m">return</span> <span class="f">&amp;</span><span class="b">zone</span><span class="f">-&gt;</span><span class="b">lruvec</span><span class="f">;</span>
<a name="290" /><span class="True">     290:</span> <span class="f">}</span>
<a name="291" /><span class="True">     291:</span> 
<a name="292" /><span class="True">     292:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">try_get_mem_cgroup_from_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="293" /><span class="True">     293:</span> <span class="f">{</span>
<a name="294" /><span class="True">     294:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="295" /><span class="True">     295:</span> <span class="f">}</span>
<a name="296" /><span class="True">     296:</span> 
<a name="297" /><span class="True">     297:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">try_get_mem_cgroup_from_mm</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">)</span>
<a name="298" /><span class="True">     298:</span> <span class="f">{</span>
<a name="299" /><span class="True">     299:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="300" /><span class="True">     300:</span> <span class="f">}</span>
<a name="301" /><span class="True">     301:</span> 
<a name="302" /><span class="True">     302:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">mm_match_cgroup</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span>
<a name="303" /><span class="True">     303:</span>         <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="304" /><span class="True">     304:</span> <span class="f">{</span>
<a name="305" /><span class="True">     305:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="306" /><span class="True">     306:</span> <span class="f">}</span>
<a name="307" /><span class="True">     307:</span> 
<a name="308" /><span class="True">     308:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">task_in_mem_cgroup</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">task</span><span class="f">,</span>
<a name="309" /><span class="True">     309:</span>                       <span class="m">const</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="310" /><span class="True">     310:</span> <span class="f">{</span>
<a name="311" /><span class="True">     311:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="312" /><span class="True">     312:</span> <span class="f">}</span>
<a name="313" /><span class="True">     313:</span> 
<a name="314" /><span class="True">     314:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">cgroup_subsys_state</span>
<a name="315" /><span class="True">     315:</span>         <span class="f">*</span><span class="b">mem_cgroup_css</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="316" /><span class="True">     316:</span> <span class="f">{</span>
<a name="317" /><span class="True">     317:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="318" /><span class="True">     318:</span> <span class="f">}</span>
<a name="319" /><span class="True">     319:</span> 
<a name="320" /><span class="True">     320:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="321" /><span class="True">     321:</span> <span class="b">mem_cgroup_prepare_migration</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">,</span>
<a name="322" /><span class="True">     322:</span>                  <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcgp</span><span class="f">)</span>
<a name="323" /><span class="True">     323:</span> <span class="f">{</span>
<a name="324" /><span class="True">     324:</span> <span class="f">}</span>
<a name="325" /><span class="True">     325:</span> 
<a name="326" /><span class="True">     326:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_end_migration</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span>
<a name="327" /><span class="True">     327:</span>         <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">oldpage</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">,</span> <span class="m">bool</span> <span class="b">migration_ok</span><span class="f">)</span>
<a name="328" /><span class="True">     328:</span> <span class="f">{</span>
<a name="329" /><span class="True">     329:</span> <span class="f">}</span>
<a name="330" /><span class="True">     330:</span> 
<a name="331" /><span class="True">     331:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span>
<a name="332" /><span class="True">     332:</span> <span class="b">mem_cgroup_iter</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span>
<a name="333" /><span class="True">     333:</span>         <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">prev</span><span class="f">,</span>
<a name="334" /><span class="True">     334:</span>         <span class="m">struct</span> <span class="b">mem_cgroup_reclaim_cookie</span> <span class="f">*</span><span class="b">reclaim</span><span class="f">)</span>
<a name="335" /><span class="True">     335:</span> <span class="f">{</span>
<a name="336" /><span class="True">     336:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="337" /><span class="True">     337:</span> <span class="f">}</span>
<a name="338" /><span class="True">     338:</span> 
<a name="339" /><span class="True">     339:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_iter_break</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span>
<a name="340" /><span class="True">     340:</span>                      <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">prev</span><span class="f">)</span>
<a name="341" /><span class="True">     341:</span> <span class="f">{</span>
<a name="342" /><span class="True">     342:</span> <span class="f">}</span>
<a name="343" /><span class="True">     343:</span> 
<a name="344" /><span class="True">     344:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">mem_cgroup_disabled</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="345" /><span class="True">     345:</span> <span class="f">{</span>
<a name="346" /><span class="True">     346:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="347" /><span class="True">     347:</span> <span class="f">}</span>
<a name="348" /><span class="True">     348:</span> 
<a name="349" /><span class="True">     349:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span>
<a name="350" /><span class="True">     350:</span> <span class="b">mem_cgroup_inactive_anon_is_low</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">)</span>
<a name="351" /><span class="True">     351:</span> <span class="f">{</span>
<a name="352" /><span class="True">     352:</span>     <span class="m">return</span> <span class="c">1</span><span class="f">;</span>
<a name="353" /><span class="True">     353:</span> <span class="f">}</span>
<a name="354" /><span class="True">     354:</span> 
<a name="355" /><span class="True">     355:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span>
<a name="356" /><span class="True">     356:</span> <span class="b">mem_cgroup_get_lru_size</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">,</span> <span class="m">enum</span> <span class="b">lru_list</span> <span class="b">lru</span><span class="f">)</span>
<a name="357" /><span class="True">     357:</span> <span class="f">{</span>
<a name="358" /><span class="True">     358:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="359" /><span class="True">     359:</span> <span class="f">}</span>
<a name="360" /><span class="True">     360:</span> 
<a name="361" /><span class="True">     361:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="362" /><span class="True">     362:</span> <span class="b">mem_cgroup_update_lru_size</span><span class="f">(</span><span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">,</span> <span class="m">enum</span> <span class="b">lru_list</span> <span class="b">lru</span><span class="f">,</span>
<a name="363" /><span class="True">     363:</span>                   <span class="m">int</span> <span class="b">increment</span><span class="f">)</span>
<a name="364" /><span class="True">     364:</span> <span class="f">{</span>
<a name="365" /><span class="True">     365:</span> <span class="f">}</span>
<a name="366" /><span class="True">     366:</span> 
<a name="367" /><span class="True">     367:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="368" /><span class="True">     368:</span> <span class="b">mem_cgroup_print_oom_info</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span>
<a name="369" /><span class="True">     369:</span> <span class="f">{</span>
<a name="370" /><span class="True">     370:</span> <span class="f">}</span>
<a name="371" /><span class="True">     371:</span> 
<a name="372" /><span class="True">     372:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_begin_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="373" /><span class="True">     373:</span>                     <span class="m">bool</span> <span class="f">*</span><span class="b">locked</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span>
<a name="374" /><span class="True">     374:</span> <span class="f">{</span>
<a name="375" /><span class="True">     375:</span> <span class="f">}</span>
<a name="376" /><span class="True">     376:</span> 
<a name="377" /><span class="True">     377:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_end_update_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="378" /><span class="True">     378:</span>                     <span class="m">bool</span> <span class="f">*</span><span class="b">locked</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">flags</span><span class="f">)</span>
<a name="379" /><span class="True">     379:</span> <span class="f">{</span>
<a name="380" /><span class="True">     380:</span> <span class="f">}</span>
<a name="381" /><span class="True">     381:</span> 
<a name="382" /><span class="True">     382:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_oom_enable</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="383" /><span class="True">     383:</span> <span class="f">{</span>
<a name="384" /><span class="True">     384:</span> <span class="f">}</span>
<a name="385" /><span class="True">     385:</span> 
<a name="386" /><span class="True">     386:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_oom_disable</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="387" /><span class="True">     387:</span> <span class="f">{</span>
<a name="388" /><span class="True">     388:</span> <span class="f">}</span>
<a name="389" /><span class="True">     389:</span> 
<a name="390" /><span class="True">     390:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">task_in_memcg_oom</span><span class="f">(</span><span class="m">struct</span> <span class="b">task_struct</span> <span class="f">*</span><span class="b">p</span><span class="f">)</span>
<a name="391" /><span class="True">     391:</span> <span class="f">{</span>
<a name="392" /><span class="True">     392:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="393" /><span class="True">     393:</span> <span class="f">}</span>
<a name="394" /><span class="True">     394:</span> 
<a name="395" /><span class="True">     395:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">mem_cgroup_oom_synchronize</span><span class="f">(</span><span class="m">bool</span> <span class="b">wait</span><span class="f">)</span>
<a name="396" /><span class="True">     396:</span> <span class="f">{</span>
<a name="397" /><span class="True">     397:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="398" /><span class="True">     398:</span> <span class="f">}</span>
<a name="399" /><span class="True">     399:</span> 
<a name="400" /><span class="True">     400:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_inc_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="401" /><span class="True">     401:</span>                         <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="b">idx</span><span class="f">)</span>
<a name="402" /><span class="True">     402:</span> <span class="f">{</span>
<a name="403" /><span class="True">     403:</span> <span class="f">}</span>
<a name="404" /><span class="True">     404:</span> 
<a name="405" /><span class="True">     405:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_dec_page_stat</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="406" /><span class="True">     406:</span>                         <span class="m">enum</span> <span class="b">mem_cgroup_stat_index</span> <span class="b">idx</span><span class="f">)</span>
<a name="407" /><span class="True">     407:</span> <span class="f">{</span>
<a name="408" /><span class="True">     408:</span> <span class="f">}</span>
<a name="409" /><span class="True">     409:</span> 
<a name="410" /><span class="True">     410:</span> <span class="m">static</span> <span class="m">inline</span>
<a name="411" /><span class="True">     411:</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">mem_cgroup_soft_limit_reclaim</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">,</span>
<a name="412" /><span class="True">     412:</span>                         <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span>
<a name="413" /><span class="True">     413:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">total_scanned</span><span class="f">)</span>
<a name="414" /><span class="True">     414:</span> <span class="f">{</span>
<a name="415" /><span class="True">     415:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="416" /><span class="True">     416:</span> <span class="f">}</span>
<a name="417" /><span class="True">     417:</span> 
<a name="418" /><span class="True">     418:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_split_huge_fixup</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">head</span><span class="f">)</span>
<a name="419" /><span class="True">     419:</span> <span class="f">{</span>
<a name="420" /><span class="True">     420:</span> <span class="f">}</span>
<a name="421" /><span class="True">     421:</span> 
<a name="422" /><span class="True">     422:</span> <span class="m">static</span> <span class="m">inline</span>
<a name="423" /><span class="True">     423:</span> <span class="m">void</span> <span class="b">mem_cgroup_count_vm_event</span><span class="f">(</span><span class="m">struct</span> <span class="b">mm_struct</span> <span class="f">*</span><span class="b">mm</span><span class="f">,</span> <span class="m">enum</span> <span class="b">vm_event_item</span> <span class="b">idx</span><span class="f">)</span>
<a name="424" /><span class="True">     424:</span> <span class="f">{</span>
<a name="425" /><span class="True">     425:</span> <span class="f">}</span>
<a name="426" /><span class="True">     426:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_replace_page_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">oldpage</span><span class="f">,</span>
<a name="427" /><span class="True">     427:</span>                 <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">newpage</span><span class="f">)</span>
<a name="428" /><span class="True">     428:</span> <span class="f">{</span>
<a name="429" /><span class="True">     429:</span> <span class="f">}</span>
<a name="430" /><span class="True">     430:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_MEMCG */</span>
<a name="431" /><span class="True">     431:</span> 
<a name="432" /><span class="True">     432:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_MEMCG</span><span class="f">)</span> <span class="f">||</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_DEBUG_VM</span><span class="f">)</span>
<a name="433" /><span class="True">     433:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span>
<a name="434" /><span class="True">     434:</span> <span class="b">mem_cgroup_bad_page_check</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="435" /><span class="True">     435:</span> <span class="f">{</span>
<a name="436" /><span class="True">     436:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="437" /><span class="True">     437:</span> <span class="f">}</span>
<a name="438" /><span class="True">     438:</span> 
<a name="439" /><span class="True">     439:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="440" /><span class="True">     440:</span> <span class="b">mem_cgroup_print_bad_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="441" /><span class="True">     441:</span> <span class="f">{</span>
<a name="442" /><span class="True">     442:</span> <span class="f">}</span>
<a name="443" /><span class="True">     443:</span> <span class="f">#</span><span class="n">endif</span>
<a name="444" /><span class="True">     444:</span> 
<a name="445" /><span class="True">     445:</span> <span class="m">enum</span> <span class="f">{</span>
<a name="446" /><span class="True">     446:</span>     <span class="b">UNDER_LIMIT</span><span class="f">,</span>
<a name="447" /><span class="True">     447:</span>     <span class="b">SOFT_LIMIT</span><span class="f">,</span>
<a name="448" /><span class="True">     448:</span>     <span class="b">OVER_LIMIT</span><span class="f">,</span>
<a name="449" /><span class="True">     449:</span> <span class="f">}</span><span class="f">;</span>
<a name="450" /><span class="True">     450:</span> 
<a name="451" /><span class="True">     451:</span> <span class="m">struct</span> <span class="b">sock</span><span class="f">;</span>
<a name="452" /><span class="False">     452:</span> <span class="f">#</span><span class="n">if</span> <span class="b">defined</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX0lORVRfMA__"><span class="b">CONFIG_INET</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">defined</span><span class="f">(</span><span class="b">CONFIG_MEMCG_KMEM</span><span class="f">)</span>
<a name="453" /><span class="False">     453:</span> <span class="m">void</span> <span class="b">sock_update_memcg</span><span class="f">(</span><span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span><span class="f">;</span>
<a name="454" /><span class="False">     454:</span> <span class="m">void</span> <span class="b">sock_release_memcg</span><span class="f">(</span><span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span><span class="f">;</span>
<a name="455" /><span class="True">     455:</span> <span class="f">#</span><span class="n">else</span>
<a name="456" /><span class="True">     456:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">sock_update_memcg</span><span class="f">(</span><span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span>
<a name="457" /><span class="True">     457:</span> <span class="f">{</span>
<a name="458" /><span class="True">     458:</span> <span class="f">}</span>
<a name="459" /><span class="True">     459:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">sock_release_memcg</span><span class="f">(</span><span class="m">struct</span> <span class="b">sock</span> <span class="f">*</span><span class="b">sk</span><span class="f">)</span>
<a name="460" /><span class="True">     460:</span> <span class="f">{</span>
<a name="461" /><span class="True">     461:</span> <span class="f">}</span>
<a name="462" /><span class="True">     462:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_INET &amp;&amp; CONFIG_MEMCG_KMEM */</span>
<a name="463" /><span class="True">     463:</span> 
<a name="464" /><span class="False">     464:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG_KMEM</span>
<a name="465" /><span class="False">     465:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">static_key</span> <span class="b">memcg_kmem_enabled_key</span><span class="f">;</span>
<a name="466" /><span class="False">     466:</span> 
<a name="467" /><span class="False">     467:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">memcg_limited_groups_array_size</span><span class="f">;</span>
<a name="468" /><span class="False">     468:</span> 
<a name="469" /><span class="False">     469:</span> <span class="k">/*</span>
<a name="470" /><span class="False">     470:</span> <span class="k"> * Helper macro to loop through all memcg-specific caches. Callers must still</span>
<a name="471" /><span class="False">     471:</span> <span class="k"> * check if the cache is valid (it is either valid or NULL).</span>
<a name="472" /><span class="False">     472:</span> <span class="k"> * the slab_mutex must be held when looping through those caches</span>
<a name="473" /><span class="False">     473:</span> <span class="k"> */</span>
<a name="474" /><span class="False">     474:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Zm9yX2VhY2hfbWVtY2dfY2FjaGVfaW5kZXhfMA__"><span class="b">for_each_memcg_cache_index</span></a><span class="f">(</span><span class="b">_idx</span><span class="f">)</span>    \
<a name="475" /><span class="False">     475:</span>     <span class="m">for</span> <span class="f">(</span><span class="f">(</span><span class="b">_idx</span><span class="f">)</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span> <span class="f">(</span><span class="b">_idx</span><span class="f">)</span> <span class="f">&lt;</span> <span class="b">memcg_limited_groups_array_size</span><span class="f">;</span> <span class="f">(</span><span class="b">_idx</span><span class="f">)</span><span class="f">++</span><span class="f">)</span>
<a name="476" /><span class="False">     476:</span> 
<a name="477" /><span class="False">     477:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="478" /><span class="False">     478:</span> <span class="f">{</span>
<a name="479" /><span class="False">     479:</span>     <span class="m">return</span> <span class="b">static_key_false</span><span class="f">(</span><span class="f">&amp;</span><span class="b">memcg_kmem_enabled_key</span><span class="f">)</span><span class="f">;</span>
<a name="480" /><span class="False">     480:</span> <span class="f">}</span>
<a name="481" /><span class="False">     481:</span> 
<a name="482" /><span class="False">     482:</span> <span class="k">/*</span>
<a name="483" /><span class="False">     483:</span> <span class="k"> * In general, we&apos;ll do everything in our power to not incur in any overhead</span>
<a name="484" /><span class="False">     484:</span> <span class="k"> * for non-memcg users for the kmem functions. Not even a function call, if we</span>
<a name="485" /><span class="False">     485:</span> <span class="k"> * can avoid it.</span>
<a name="486" /><span class="False">     486:</span> <span class="k"> *</span>
<a name="487" /><span class="False">     487:</span> <span class="k"> * Therefore, we&apos;ll inline all those functions so that in the best case, we&apos;ll</span>
<a name="488" /><span class="False">     488:</span> <span class="k"> * see that kmemcg is off for everybody and proceed quickly.  If it is on,</span>
<a name="489" /><span class="False">     489:</span> <span class="k"> * we&apos;ll still do most of the flag checking inline. We check a lot of</span>
<a name="490" /><span class="False">     490:</span> <span class="k"> * conditions, but because they are pretty simple, they are expected to be</span>
<a name="491" /><span class="False">     491:</span> <span class="k"> * fast.</span>
<a name="492" /><span class="False">     492:</span> <span class="k"> */</span>
<a name="493" /><span class="False">     493:</span> <span class="m">bool</span> <span class="b">__memcg_kmem_newpage_charge</span><span class="f">(</span><span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcg</span><span class="f">,</span>
<a name="494" /><span class="False">     494:</span>                     <span class="m">int</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="495" /><span class="False">     495:</span> <span class="m">void</span> <span class="b">__memcg_kmem_commit_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span>
<a name="496" /><span class="False">     496:</span>                        <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="497" /><span class="False">     497:</span> <span class="m">void</span> <span class="b">__memcg_kmem_uncharge_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="498" /><span class="False">     498:</span> 
<a name="499" /><span class="False">     499:</span> <span class="m">int</span> <span class="b">memcg_cache_id</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span><span class="f">;</span>
<a name="500" /><span class="False">     500:</span> <span class="m">int</span> <span class="b">memcg_register_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">,</span>
<a name="501" /><span class="False">     501:</span>              <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">root_cache</span><span class="f">)</span><span class="f">;</span>
<a name="502" /><span class="False">     502:</span> <span class="m">void</span> <span class="b">memcg_release_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">)</span><span class="f">;</span>
<a name="503" /><span class="False">     503:</span> <span class="m">void</span> <span class="b">memcg_cache_list_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">)</span><span class="f">;</span>
<a name="504" /><span class="False">     504:</span> 
<a name="505" /><span class="False">     505:</span> <span class="m">int</span> <span class="b">memcg_update_cache_size</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">,</span> <span class="m">int</span> <span class="b">num_groups</span><span class="f">)</span><span class="f">;</span>
<a name="506" /><span class="False">     506:</span> <span class="m">void</span> <span class="b">memcg_update_array_size</span><span class="f">(</span><span class="m">int</span> <span class="b">num_groups</span><span class="f">)</span><span class="f">;</span>
<a name="507" /><span class="False">     507:</span> 
<a name="508" /><span class="False">     508:</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span>
<a name="509" /><span class="False">     509:</span> <span class="b">__memcg_kmem_get_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span><span class="f">;</span>
<a name="510" /><span class="False">     510:</span> 
<a name="511" /><span class="False">     511:</span> <span class="m">void</span> <span class="b">mem_cgroup_destroy_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">)</span><span class="f">;</span>
<a name="512" /><span class="False">     512:</span> <span class="m">void</span> <span class="b">kmem_cache_destroy_memcg_children</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">)</span><span class="f">;</span>
<a name="513" /><span class="False">     513:</span> 
<a name="514" /><span class="False">     514:</span> <span class="k">/**</span>
<a name="515" /><span class="False">     515:</span> <span class="k"> * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed.</span>
<a name="516" /><span class="False">     516:</span> <span class="k"> * @gfp: the gfp allocation flags.</span>
<a name="517" /><span class="False">     517:</span> <span class="k"> * @memcg: a pointer to the memcg this was charged against.</span>
<a name="518" /><span class="False">     518:</span> <span class="k"> * @order: allocation order.</span>
<a name="519" /><span class="False">     519:</span> <span class="k"> *</span>
<a name="520" /><span class="False">     520:</span> <span class="k"> * returns true if the memcg where the current task belongs can hold this</span>
<a name="521" /><span class="False">     521:</span> <span class="k"> * allocation.</span>
<a name="522" /><span class="False">     522:</span> <span class="k"> *</span>
<a name="523" /><span class="False">     523:</span> <span class="k"> * We return true automatically if this allocation is not to be accounted to</span>
<a name="524" /><span class="False">     524:</span> <span class="k"> * any memcg.</span>
<a name="525" /><span class="False">     525:</span> <span class="k"> */</span>
<a name="526" /><span class="False">     526:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span>
<a name="527" /><span class="False">     527:</span> <span class="b">memcg_kmem_newpage_charge</span><span class="f">(</span><span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="528" /><span class="False">     528:</span> <span class="f">{</span>
<a name="529" /><span class="False">     529:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="530" /><span class="False">     530:</span>         <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="531" /><span class="False">     531:</span> 
<a name="532" /><span class="False">     532:</span>     <span class="k">/*</span>
<a name="533" /><span class="False">     533:</span> <span class="k">     * __GFP_NOFAIL allocations will move on even if charging is not</span>
<a name="534" /><span class="False">     534:</span> <span class="k">     * possible. Therefore we don&apos;t even try, and have this allocation</span>
<a name="535" /><span class="False">     535:</span> <span class="k">     * unaccounted. We could in theory charge it with</span>
<a name="536" /><span class="False">     536:</span> <span class="k">     * res_counter_charge_nofail, but we hope those allocations are rare,</span>
<a name="537" /><span class="False">     537:</span> <span class="k">     * and won&apos;t be worth the trouble.</span>
<a name="538" /><span class="False">     538:</span> <span class="k">     */</span>
<a name="539" /><span class="False">     539:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="f">(</span><span class="b">gfp</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_X19HRlBfS01FTUNHXzA_"><span class="b">__GFP_KMEMCG</span></a><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><span class="b">gfp</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_X19HRlBfTk9GQUlMXzA_"><span class="b">__GFP_NOFAIL</span></a><span class="f">)</span><span class="f">)</span>
<a name="540" /><span class="False">     540:</span>         <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="541" /><span class="False">     541:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_noref.html#_aW5faW50ZXJydXB0XzA_"><span class="b">in_interrupt</span></a><span class="f">(</span><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><span class="f">!</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">mm</span><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_UEZfS1RIUkVBRF8w"><span class="b">PF_KTHREAD</span></a><span class="f">)</span><span class="f">)</span>
<a name="542" /><span class="False">     542:</span>         <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="543" /><span class="False">     543:</span> 
<a name="544" /><span class="False">     544:</span>     <span class="k">/* If the test is dying, just let it go. */</span>
<a name="545" /><span class="False">     545:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">fatal_signal_pending</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="546" /><span class="False">     546:</span>         <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="547" /><span class="False">     547:</span> 
<a name="548" /><span class="False">     548:</span>     <span class="m">return</span> <span class="b">__memcg_kmem_newpage_charge</span><span class="f">(</span><span class="b">gfp</span><span class="f">,</span> <span class="b">memcg</span><span class="f">,</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="549" /><span class="False">     549:</span> <span class="f">}</span>
<a name="550" /><span class="False">     550:</span> 
<a name="551" /><span class="False">     551:</span> <span class="k">/**</span>
<a name="552" /><span class="False">     552:</span> <span class="k"> * memcg_kmem_uncharge_pages: uncharge pages from memcg</span>
<a name="553" /><span class="False">     553:</span> <span class="k"> * @page: pointer to struct page being freed</span>
<a name="554" /><span class="False">     554:</span> <span class="k"> * @order: allocation order.</span>
<a name="555" /><span class="False">     555:</span> <span class="k"> *</span>
<a name="556" /><span class="False">     556:</span> <span class="k"> * there is no need to specify memcg here, since it is embedded in page_cgroup</span>
<a name="557" /><span class="False">     557:</span> <span class="k"> */</span>
<a name="558" /><span class="False">     558:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="559" /><span class="False">     559:</span> <span class="b">memcg_kmem_uncharge_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="560" /><span class="False">     560:</span> <span class="f">{</span>
<a name="561" /><span class="False">     561:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="562" /><span class="False">     562:</span>         <span class="b">__memcg_kmem_uncharge_pages</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="563" /><span class="False">     563:</span> <span class="f">}</span>
<a name="564" /><span class="False">     564:</span> 
<a name="565" /><span class="False">     565:</span> <span class="k">/**</span>
<a name="566" /><span class="False">     566:</span> <span class="k"> * memcg_kmem_commit_charge: embeds correct memcg in a page</span>
<a name="567" /><span class="False">     567:</span> <span class="k"> * @page: pointer to struct page recently allocated</span>
<a name="568" /><span class="False">     568:</span> <span class="k"> * @memcg: the memcg structure we charged against</span>
<a name="569" /><span class="False">     569:</span> <span class="k"> * @order: allocation order.</span>
<a name="570" /><span class="False">     570:</span> <span class="k"> *</span>
<a name="571" /><span class="False">     571:</span> <span class="k"> * Needs to be called after memcg_kmem_newpage_charge, regardless of success or</span>
<a name="572" /><span class="False">     572:</span> <span class="k"> * failure of the allocation. if @page is NULL, this function will revert the</span>
<a name="573" /><span class="False">     573:</span> <span class="k"> * charges. Otherwise, it will commit the memcg given by @memcg to the</span>
<a name="574" /><span class="False">     574:</span> <span class="k"> * corresponding page_cgroup.</span>
<a name="575" /><span class="False">     575:</span> <span class="k"> */</span>
<a name="576" /><span class="False">     576:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="577" /><span class="False">     577:</span> <span class="b">memcg_kmem_commit_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="578" /><span class="False">     578:</span> <span class="f">{</span>
<a name="579" /><span class="False">     579:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <span class="b">memcg</span><span class="f">)</span>
<a name="580" /><span class="False">     580:</span>         <span class="b">__memcg_kmem_commit_charge</span><span class="f">(</span><span class="b">page</span><span class="f">,</span> <span class="b">memcg</span><span class="f">,</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="581" /><span class="False">     581:</span> <span class="f">}</span>
<a name="582" /><span class="False">     582:</span> 
<a name="583" /><span class="False">     583:</span> <span class="k">/**</span>
<a name="584" /><span class="False">     584:</span> <span class="k"> * memcg_kmem_get_cache: selects the correct per-memcg cache for allocation</span>
<a name="585" /><span class="False">     585:</span> <span class="k"> * @cachep: the original global kmem cache</span>
<a name="586" /><span class="False">     586:</span> <span class="k"> * @gfp: allocation flags.</span>
<a name="587" /><span class="False">     587:</span> <span class="k"> *</span>
<a name="588" /><span class="False">     588:</span> <span class="k"> * This function assumes that the task allocating, which determines the memcg</span>
<a name="589" /><span class="False">     589:</span> <span class="k"> * in the page allocator, belongs to the same cgroup throughout the whole</span>
<a name="590" /><span class="False">     590:</span> <span class="k"> * process.  Misacounting can happen if the task calls memcg_kmem_get_cache()</span>
<a name="591" /><span class="False">     591:</span> <span class="k"> * while belonging to a cgroup, and later on changes. This is considered</span>
<a name="592" /><span class="False">     592:</span> <span class="k"> * acceptable, and should only happen upon task migration.</span>
<a name="593" /><span class="False">     593:</span> <span class="k"> *</span>
<a name="594" /><span class="False">     594:</span> <span class="k"> * Before the cache is created by the memcg core, there is also a possible</span>
<a name="595" /><span class="False">     595:</span> <span class="k"> * imbalance: the task belongs to a memcg, but the cache being allocated from</span>
<a name="596" /><span class="False">     596:</span> <span class="k"> * is the global cache, since the child cache is not yet guaranteed to be</span>
<a name="597" /><span class="False">     597:</span> <span class="k"> * ready. This case is also fine, since in this case the GFP_KMEMCG will not be</span>
<a name="598" /><span class="False">     598:</span> <span class="k"> * passed and the page allocator will not attempt any cgroup accounting.</span>
<a name="599" /><span class="False">     599:</span> <span class="k"> */</span>
<a name="600" /><span class="False">     600:</span> <span class="m">static</span> <a href="cpu.c_macros_ref.html#_X19hbHdheXNfaW5saW5lXzA_"><span class="b">__always_inline</span></a> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span>
<a name="601" /><span class="False">     601:</span> <span class="b">memcg_kmem_get_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span>
<a name="602" /><span class="False">     602:</span> <span class="f">{</span>
<a name="603" /><span class="False">     603:</span>     <span class="m">if</span> <span class="f">(</span><span class="f">!</span><span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="f">)</span><span class="f">)</span>
<a name="604" /><span class="False">     604:</span>         <span class="m">return</span> <span class="b">cachep</span><span class="f">;</span>
<a name="605" /><span class="False">     605:</span>     <span class="m">if</span> <span class="f">(</span><span class="b">gfp</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_X19HRlBfTk9GQUlMXzA_"><span class="b">__GFP_NOFAIL</span></a><span class="f">)</span>
<a name="606" /><span class="False">     606:</span>         <span class="m">return</span> <span class="b">cachep</span><span class="f">;</span>
<a name="607" /><span class="False">     607:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_noref.html#_aW5faW50ZXJydXB0XzA_"><span class="b">in_interrupt</span></a><span class="f">(</span><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><span class="f">!</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">mm</span><span class="f">)</span> <span class="f">||</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_noref.html#_UEZfS1RIUkVBRF8w"><span class="b">PF_KTHREAD</span></a><span class="f">)</span><span class="f">)</span>
<a name="608" /><span class="False">     608:</span>         <span class="m">return</span> <span class="b">cachep</span><span class="f">;</span>
<a name="609" /><span class="False">     609:</span>     <span class="m">if</span> <span class="f">(</span><a href="cpu.c_macros_ref.html#_dW5saWtlbHlfMA__"><span class="b">unlikely</span></a><span class="f">(</span><span class="b">fatal_signal_pending</span><span class="f">(</span><a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="610" /><span class="False">     610:</span>         <span class="m">return</span> <span class="b">cachep</span><span class="f">;</span>
<a name="611" /><span class="False">     611:</span> 
<a name="612" /><span class="False">     612:</span>     <span class="m">return</span> <span class="b">__memcg_kmem_get_cache</span><span class="f">(</span><span class="b">cachep</span><span class="f">,</span> <span class="b">gfp</span><span class="f">)</span><span class="f">;</span>
<a name="613" /><span class="False">     613:</span> <span class="f">}</span>
<a name="614" /><span class="True">     614:</span> <span class="f">#</span><span class="n">else</span>
<a name="615" /><span class="True">     615:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Zm9yX2VhY2hfbWVtY2dfY2FjaGVfaW5kZXhfMA__"><span class="b">for_each_memcg_cache_index</span></a><span class="f">(</span><span class="b">_idx</span><span class="f">)</span>    \
<a name="616" /><span class="True">     616:</span>     <span class="m">for</span> <span class="f">(</span><span class="f">;</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span> <span class="f">)</span>
<a name="617" /><span class="True">     617:</span> 
<a name="618" /><span class="True">     618:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">memcg_kmem_enabled</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="619" /><span class="True">     619:</span> <span class="f">{</span>
<a name="620" /><span class="True">     620:</span>     <span class="m">return</span> <span class="m">false</span><span class="f">;</span>
<a name="621" /><span class="True">     621:</span> <span class="f">}</span>
<a name="622" /><span class="True">     622:</span> 
<a name="623" /><span class="True">     623:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span>
<a name="624" /><span class="True">     624:</span> <span class="b">memcg_kmem_newpage_charge</span><span class="f">(</span><span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="625" /><span class="True">     625:</span> <span class="f">{</span>
<a name="626" /><span class="True">     626:</span>     <span class="m">return</span> <span class="m">true</span><span class="f">;</span>
<a name="627" /><span class="True">     627:</span> <span class="f">}</span>
<a name="628" /><span class="True">     628:</span> 
<a name="629" /><span class="True">     629:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">memcg_kmem_uncharge_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="630" /><span class="True">     630:</span> <span class="f">{</span>
<a name="631" /><span class="True">     631:</span> <span class="f">}</span>
<a name="632" /><span class="True">     632:</span> 
<a name="633" /><span class="True">     633:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="634" /><span class="True">     634:</span> <span class="b">memcg_kmem_commit_charge</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="635" /><span class="True">     635:</span> <span class="f">{</span>
<a name="636" /><span class="True">     636:</span> <span class="f">}</span>
<a name="637" /><span class="True">     637:</span> 
<a name="638" /><span class="True">     638:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">memcg_cache_id</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">)</span>
<a name="639" /><span class="True">     639:</span> <span class="f">{</span>
<a name="640" /><span class="True">     640:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="641" /><span class="True">     641:</span> <span class="f">}</span>
<a name="642" /><span class="True">     642:</span> 
<a name="643" /><span class="True">     643:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span>
<a name="644" /><span class="True">     644:</span> <span class="b">memcg_register_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">,</span>
<a name="645" /><span class="True">     645:</span>              <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">root_cache</span><span class="f">)</span>
<a name="646" /><span class="True">     646:</span> <span class="f">{</span>
<a name="647" /><span class="True">     647:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="648" /><span class="True">     648:</span> <span class="f">}</span>
<a name="649" /><span class="True">     649:</span> 
<a name="650" /><span class="True">     650:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">memcg_release_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">)</span>
<a name="651" /><span class="True">     651:</span> <span class="f">{</span>
<a name="652" /><span class="True">     652:</span> <span class="f">}</span>
<a name="653" /><span class="True">     653:</span> 
<a name="654" /><span class="True">     654:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">memcg_cache_list_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">memcg</span><span class="f">,</span>
<a name="655" /><span class="True">     655:</span>                     <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">)</span>
<a name="656" /><span class="True">     656:</span> <span class="f">{</span>
<a name="657" /><span class="True">     657:</span> <span class="f">}</span>
<a name="658" /><span class="True">     658:</span> 
<a name="659" /><span class="True">     659:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span>
<a name="660" /><span class="True">     660:</span> <span class="b">memcg_kmem_get_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">cachep</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp</span><span class="f">)</span>
<a name="661" /><span class="True">     661:</span> <span class="f">{</span>
<a name="662" /><span class="True">     662:</span>     <span class="m">return</span> <span class="b">cachep</span><span class="f">;</span>
<a name="663" /><span class="True">     663:</span> <span class="f">}</span>
<a name="664" /><span class="True">     664:</span> 
<a name="665" /><span class="True">     665:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">kmem_cache_destroy_memcg_children</span><span class="f">(</span><span class="m">struct</span> <span class="b">kmem_cache</span> <span class="f">*</span><span class="b">s</span><span class="f">)</span>
<a name="666" /><span class="True">     666:</span> <span class="f">{</span>
<a name="667" /><span class="True">     667:</span> <span class="f">}</span>
<a name="668" /><span class="True">     668:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_MEMCG_KMEM */</span>
<a name="669" /><span class="True">     669:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _LINUX_MEMCONTROL_H */</span>
<a name="670" /><span class="True">     670:</span> 
<a name="671" /><span class="True">     671:</span> </pre>
  </body>
</html>
